# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=srt
pkgver=1.5.1
pkgrel=3
pkgdesc="Secure Reliable Transport library"
url="https://www.srtalliance.org/"
arch=(x86_64)
license=(MPL2)
depends=(openssl)
makedepends=(git cmake ninja)
options=(debug)
_commit=0bc3b03202b3159fc9b085b3ae6d66ec071c25d6  # tags/v1.5.1
source=("git+https://github.com/Haivision/srt#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd srt
  git describe --tags | sed 's/^v//;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd srt
}

build() {
  cmake -S srt -B build -G Ninja \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=None \
    -DENABLE_STATIC=ON \
    -DENABLE_TESTING=ON
  cmake --build build
}

check() {
  cd build
  ./uriparser-test
  ./utility-test
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}

# vim:set sw=2 sts=-1 et:
